<html>
<head>
    <script src="../resources/cross-frame-access.js"></script>
    <script>
        var openedWindow;

        window.onload = function()
        {
            if (window.testRunner) {
                testRunner.dumpAsText();
                testRunner.waitUntilDone();
                testRunner.setPopupBlockingEnabled(false);
            }

            window.addEventListener('message', function ()
            {
                runTest();
                closeWindowAndNotifyDone(openedWindow);
            });
            openedWindow = window.open("http://localhost:8000/security/dataURL/resources/foreign-domain-data-url-accessee-opened-frame.html");
        }

        runTest = function()
        {
            try {
                openedWindow[0].document.getElementById('accessMe').innerHTML = "FAIL: Cross frame access to a data: URL embed in a frame window.open'ed on foreign domain allowed.";
                log("FAIL: Cross frame access to a data: URL embed in a frame window.open'ed on foreign domain allowed.");
                return;
            } catch (e) {
            }
            log("PASS: Cross frame access to a data: URL embed in a frame window.open'ed on foreign domain denied!");
        }
    </script>
</head>
<body>
    <pre id="console"></pre>
</body>
</html>
